/**
 * Created by user on 2018/3/20.
 */
import React, { Component } from 'react'
import { connect } from 'react-redux'
import GlobalTitle from '../globalTitle'
import MiddleTip from '../middleTip'

class BeforeScreen extends Component {
  render() {
    const { cover, showDm } = this.props
    const style = cover ? { backgroundImage: 'url(' + cover + ')' } : null
    return(
      <div>
        <GlobalTitle/>
        <div className={`before_screen ${showDm ? 'showDm' : 'hideDm'}`}>
          <MiddleTip text="等待讲师开始直播~"/>
          <div className="before_image" style={ style }></div>
        </div>
      </div>
    )
  }
}
const mapStateToProps = (state) => {
  return {
    cover: state.MainScreenState.info.cover,
    showDm: state.DmState.show
  }
}
export default connect(mapStateToProps)(BeforeScreen)
